package com.rainyun.rd.util;

import com.rainyun.rcmc.mc.annotation.NmsComp;
import net.minecraft.server.v1_12_R1.NBTTagCompound;
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;

/**nms工具类*/
@NmsComp
public class RdNmsUtil {

    //获取物品nbt
    public String getNBT(ItemStack item){
        net.minecraft.server.v1_12_R1.ItemStack nmsi = CraftItemStack.asNMSCopy(item);
        NBTTagCompound tag = nmsi.getTag();
        return tag!=null?tag.toString():null;
    }

}
